<%--
  @desc: 应用列表首页
  @author: chenw
  @create: 2014-4-29 下午 15:32
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style type="text/css">
    .pageFormContent .textInput { width: 220px; }
    .gray { color: gray; }
</style>
<div class="pageContent" style="padding-top: 1px;width:420px;height:220px;">
    <form id="pagerForm" method="post" action="<c:url value='/sys/resource/edit'/>" class="pageForm required-validate"
          onsubmit="return validateCallback(this,callbackForSubmit);">
        <div class="pageFormContent">
            <p>
                <label for="txt_resource_name" class="required">资源名称</label>
                <input id="txt_resource_name" type="text" name="name" class="required" maxlength="50" value="${resource.name}"/>
            </p>
            <p>
                <label for="txt_resource_path" class="required">资源路径</label>
                <input id="txt_resource_path" type="text" class="gray" maxlength="251" value="com...${resource.method}" readonly
                       title="${resource.pkg}#${resource.method}"/>
            </p>
            <p>
                <label for="txt_resource_remark">备注信息</label>
                <input id="txt_resource_remark" type="text" name="remark" maxlength="300" value="${resource.remark}"/>
            </p>
            <p>
                <label for="txt_resource_sort">排序</label>
                <input id="txt_resource_sort" type="text" name="sort" class="required numberbox" maxlength="4" value="${resource.sort}"/>
            </p>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">保存</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">取消</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <input type="hidden" name="id" value="${resource.id}"/>
    </form>
</div>
<script type="text/javascript">
    function callbackForSubmit(resp, st, xhr) {
        if (resp && resp.succ) {
            alertMsg.info("更新成功！");
            $.pdialog.closeCurrent();
            navTab.reloadFlag('page_sys_resource_list')
        } else {
            alertMsg.info(resp.msg + "!");
        }
    }
</script>